<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title>家庭信息</title>
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="Cache-Control" content="no-cache, must-revalidate">
		<meta http-equiv="expires" content="0">
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
		<!--标准mui.css-->
		<link rel="stylesheet" href="../css/mui.min.css">
		<link rel="stylesheet" href="../css/mui.picker.min.css" />
		<link rel="stylesheet" href="../css/mui.poppicker.css" />
		<link rel="stylesheet" href="../css/common.css" />
		<style>
			* {
				margin: 0px;
				padding: 0px;
			}
			body {
				background-color: #FFFFFF;
			}
			.mui-content {
				margin-bottom: 60px;
				background-color: #FFFFFF;
			}
			.info-div {
				width: 100%;
				background-color: #FFFFFF;
			}
			.item-div {
				margin: 0px 28px;
				height: 55px;
				position: relative;
			}
			.item-span {
				line-height: 55px;
				font-family: 'PingFangSC-Regular';
				font-size: 14px;
				color: #666666;
			}
			.item-icon {
				width: 20px;
				height: 20px;
				position: absolute;
				right: 0px;
				top: 22px;
			}
			input[type=text] {
				padding: 0px;
			    float: right;
	    			width: 65%;
				margin-bottom: 0;
				height: 55px; 
				border-width: 0px;
				color:#515151;
				font-size: 15px;
				background-color: transparent;
			}
			::-webkit-input-placeholder{
			    font-family: 'PingFangSC-Regular';
				font-size: 14px;
				color: #999999;
			}
			.right-div-container {
				display: inline-block;
				float: right;
				width: 65%;
			}
			.right-div {
				display: inline-block;
				float: right;
			}
			.right-span {
				line-height: 55px;
				font-size: 14px;
				color: #999999;
			}
			.choose-img {
				width: 32px;
				height: 32px;
				margin-top: 8px;
			}
			.record-container {
				margin-top: 20px;
				width: 94%;
				margin-left: 3%;
				border: 1px solid #F3F3F3;
				border-radius: 4px;
			}
			.record-title-div {
				width: 100%;
				height: 50px;
				background-color: #FAFAFA;;
				font-family: 'PingFangSC-Medium';
				font-size: 16px;
				color: #333333;
				text-align: center;
				line-height: 50px;
			}
			#spousePanel {
				display: none;
				margin-bottom: 20px;
			}
			#childrenPanel, .childrenId-div {
				display: none;
			}
			.delete-div {
				text-align: center;
			}
		</style>
	</head>

	<body>
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title">家庭信息</h1>
		</header>
		<div class="mui-content">
			<div class="info-div">
				<div class="item-div">
					<span class="item-span">婚姻状况</span>
					<div id="showIsMarriedPicker" class="right-div-container marriedPicker">
						<span class="right-span marriedResult" id="meMarried">单身</span>
						<div class="right-div">
							<img class="choose-img" src="../img/detail/down_color_icon.png" />
						</div>
					</div>
				</div>
				<div class="line-div"></div>
			</div>
			<div id="spousePanel" class="info-div">
				<div class="record-container">
					<div class="record-title-div">配偶信息</div>
						<div class="item-div">
						<span class="item-span">曾用姓（中文）</span>
						<input type="text" name="surnameOSC" id="surnameOSC" placeholder="请输入中文姓"/>
					</div>
					<div class="line-div"></div>
					<div class="item-div">
						<span class="item-span">曾用名（中文）</span>
						<input type="text" name="nameOSC" id="nameOSC" placeholder="请输入中文名"/>
					</div>
					<div class="line-div"></div>
					<div class="item-div">
						<span class="item-span">曾用姓（拼音）</span>
						<input type="text" name="surnameOSP" id="surnameOSP" placeholder="请输入中文名"/>
					</div>
					<div class="line-div"></div>
					<div class="item-div">
						<span class="item-span">曾用名（拼音）</span>
						<input type="text" name="nameOSP" id="nameOSP" placeholder="请输入中文名"/>
					</div>
					<div class="line-div"></div>
					<div class="item-div">
						<span class="item-span">电话</span>
						<input type="text" name="phoneS" id="phoneS" placeholder="请填写电话号码"/>
					</div>
					<div class="line-div"></div>
					<div class="item-div">
						<span class="item-span">出生日期</span>
						<div class="right-div-container datePicker" data-options='{"type":"date","beginYear":1900,"endYear":2100}'>
							<span id="birthdayS" class="right-span dateResult">请填写日期</span>
							<div class="right-div">
								<img class="choose-img" src="../img/detail/down_color_icon.png" />
							</div>
						</div>
					</div>
					<div class="line-div"></div>
					<div class="item-div">
						<span class="item-span">结婚日期</span>
						<div class="right-div-container datePicker" data-options='{"type":"date","beginYear":1900,"endYear":2100}'>
							<span id="marriedTimeS" class="right-span dateResult">请填写日期</span>
							<div class="right-div">
								<img class="choose-img" src="../img/detail/down_color_icon.png" />
							</div>
						</div>
					</div>
				</div>
			</div>
			<div class="info-div">
				<div class="record-container">
					<div class="record-title-div">父亲信息</div>
						<div class="item-div">
						<span class="item-span">曾用姓（中文）</span>
						<input type="text" name="surnameOFC" id="surnameOFC" placeholder="请输入中文姓"/>
					</div>
					<div class="line-div"></div>
					<div class="item-div">
						<span class="item-span">曾用名（中文）</span>
						<input type="text" name="nameOFC" id="nameOFC" placeholder="请输入中文名"/>
					</div>
					<div class="line-div"></div>
					<div class="item-div">
						<span class="item-span">曾用姓（拼音）</span>
						<input type="text" name="surnameOFP" id="surnameOFP" placeholder="请输入中文名"/>
					</div>
					<div class="line-div"></div>
					<div class="item-div">
						<span class="item-span">曾用名（拼音）</span>
						<input type="text" name="nameOFP" id="nameOFP" placeholder="请输入中文名"/>
					</div>
					<div class="line-div"></div>
					<div class="item-div">
						<span class="item-span">国籍</span>
						<input type="text" name="nationalityF" id="nationalityF" placeholder="请填写国籍" value=""/>
					</div>
					<div class="line-div"></div>
					<div id="nowAddr" class="item-div">
						<span class="item-span">出生日期</span>
						<div class="right-div-container datePicker" data-options='{"type":"date","beginYear":1900,"endYear":2100}'>
							<span id="birthdayF" class="right-span dateResult">请填写日期</span>
							<div class="right-div">
								<img class="choose-img" src="../img/detail/down_color_icon.png" />
							</div>
						</div>
					</div>
					<div class="line-div"></div>
					<div  class="item-div">
						<span class="item-span">婚姻状况</span>
						<div id="showMarriedFPicker" class="right-div-container marriedPicker">
							<span class="right-span marriedResult" id="fatherMarried">单身</span>
							<div class="right-div">
								<img class="choose-img" src="../img/detail/down_color_icon.png" />
							</div>
						</div>
					</div>
					<div class="line-div"></div>
					<div class="item-div">
						<span class="item-span">是否健在</span>
						<div class="right-div-container livePicker">
							<span class="right-span liveResult" id="FatherLive">是</span>
							<div class="right-div">
								<img class="choose-img" src="../img/detail/down_color_icon.png" />
							</div>
						</div>
					</div>
				</div>
				<div class="record-container">
					<div class="record-title-div">母亲信息</div>
						<div class="item-div">
						<span class="item-span">曾用姓（中文）</span>
						<input type="text" name="surnameOMC" id="surnameOMC" placeholder="请输入中文姓"/>
					</div>
					<div class="line-div"></div>
					<div class="item-div">
						<span class="item-span">曾用名（中文）</span>
						<input type="text" name="nameOMC" id="nameOMC" placeholder="请输入中文名"/>
					</div>
					<div class="line-div"></div>
					<div class="item-div">
						<span class="item-span">曾用姓（拼音）</span>
						<input type="text" name="surnameOMP" id="surnameOMP" placeholder="请输入中文名"/>
					</div>
					<div class="line-div"></div>
					<div class="item-div">
						<span class="item-span">曾用名（拼音）</span>
						<input type="text" name="nameOMP" id="nameOMP" placeholder="请输入中文名"/>
					</div>
					<div class="line-div"></div>
					<div class="item-div">
						<span class="item-span">国籍</span>
						<input type="text" name="nationalityM" id="nationalityM" placeholder="请填写国籍" value=""/>
					</div>
					<div class="line-div"></div>
					<div class="item-div">
						<span class="item-span">出生日期</span>
						<div class="right-div-container datePicker" data-options='{"type":"date","beginYear":1900,"endYear":2100}'>
							<span id="birthdayM" class="right-span dateResult">请填写日期</span>
							<div class="right-div">
								<img class="choose-img" src="../img/detail/down_color_icon.png" />
							</div>
						</div>
					</div>
					<div class="line-div"></div>
					<div class="item-div">
						<span class="item-span">婚姻状况</span>
						<div class="right-div-container marriedPicker">
							<span class="right-span marriedResult" id="motherMarried">单身</span>
							<div class="right-div">
								<img class="choose-img" src="../img/detail/down_color_icon.png" />
							</div>
						</div>
					</div>
					<div class="line-div"></div>
					<div class="item-div">
						<span class="item-span">是否健在</span>
						<div class="right-div-container livePicker">
							<span class="right-span liveResult" id="motherLive">是</span>
							<div class="right-div">
								<img class="choose-img" src="../img/detail/down_color_icon.png" />
							</div>
						</div>
					</div>
				</div>
				<div class="item-div">
					<span class="item-span">是否有子女</span>
					<div id="isChildPicker" class="right-div-container">
						<span class="right-span" id="isChildResult">否</span>
						<div class="right-div">
							<img class="choose-img" src="../img/detail/down_color_icon.png" />
						</div>
					</div>
				</div>
				<div class="line-div"></div>
			</div>
			<div id="childrenPanel" class="info-div">
				<div id="addChildren" class="item-div">
					<span class="item-span">子女信息</span>
					<div class="right-div-container">
						<span class="right-span">注：可添加多个子女信息</span>
						<div class="right-div">
							<span class="right-span" style="color: #FF4747;">＋新增</span>
						</div>
					</div>
				</div>
				<div class="line-div"></div>
				<div id="childInfo" class="info-div"></div>
			</div>
			<div class="transaction-container"><button type="button">保存</button></div>
		</div>
	</body>
	<script type="text/javascript" src="../js/thirdparty/jquery-3.3.1.js" ></script>
	<script type="text/javascript" src="../js/thirdparty/mui.min.js" ></script>
	<script type="text/javascript" src="../js/utils/regular.js" ></script>
	<script type="text/javascript" src="../js/thirdparty/mui.picker.min.js"></script>
	<script type="text/javascript" src="../js/thirdparty/mui.poppicker.js"></script>
	<script type="text/javascript" src="../js/thirdparty/city.data.js" ></script>
	<script type="text/javascript" src="../js/thirdparty/city.data-3.js" ></script>
	<script type="text/javascript" src="../js/thirdparty/spin.min.js" ></script>
	<script type="text/javascript" src="../js/utils/boot.js" ></script>
	<script type="text/javascript">
		var customerId = base.getParameter("customerId");
		var applyCustomerId = base.getParameter("applyCustomerId");
		var familyId = null;
		var _getParam = function(obj, param) {
			return obj[param] || '';
		};
		(function($, doc) {
			$.init();
			getFamilyListData();//获取家庭信息
			//是否有子女
			var isChildPicker = new $.PopPicker();
			isChildPicker.setData([{
				value: '0',
				text: '否'
			}, {
				value: '1',
				text: '是'
			}]);
			var _showIsChildPicker = doc.getElementById('isChildPicker');
			var _isChildResult = doc.getElementById('isChildResult');
			_showIsChildPicker.addEventListener('tap', function(event) {
				isChildPicker.show(function(items) {
					_isChildResult.innerText = _getParam(items[0], "text");
					if (_getParam(items[0], "value") == 1) {
						jQuery('#childrenPanel').show();
						jQuery('#childInfo').prepend(getChildHtml());
					} else {
						jQuery('#childrenPanel').hide();
					}
				});
			}, false);
			//是否健在
			var _livePicker = new $.PopPicker();
			_livePicker.setData([{
				value: '1',
				text: '是'
			}, {
				value: '2',
				text: '否'
			}]);
			$(".mui-content").on("tap", ".livePicker", function() {
				document.activeElement.blur();
				var _self = this;
				_livePicker.show(function(items) {
					jQuery(_self).find('.liveResult').html(_getParam(items[0], 'text'));
				});
			})
			//子女与您的关系
			var _relationPicker = new $.PopPicker();
			_relationPicker.setData([{
				value: '1',
				text: '女儿'
			}, {
				value: '2',
				text: '儿子'
			}, {
				value: '3',
				text: '继女'
			}, {
				value: '4',
				text: '继子'
			}, {
				value: '5',
				text: '养女'
			}, {
				value: '6',
				text: '养子'
			}]);
			$(".mui-content").on("tap", ".relationPicker", function() {
				document.activeElement.blur();
				var _self = this;
				_relationPicker.show(function(items) {
					jQuery(_self).find('.relationResult').html(_getParam(items[0], 'text'));
				});
			})
			//婚姻状况
			var _marriedPicker = new $.PopPicker();
			_marriedPicker.setData([{
				value: '0',
				text: '单身'
			}, {
				value: '1',
				text: '已婚'
			}, {
				value: '2',
				text: '离异'
			}, {
				value: '3',
				text: '丧偶'
			}]);
			$(".mui-content").on("tap", ".marriedPicker", function() {
				document.activeElement.blur();
				var _self = this;
				_marriedPicker.show(function(items) {
					jQuery(_self).find('.marriedResult').html(_getParam(items[0], 'text'));
					//判断是否为自己的婚姻状况
					if(jQuery(_self).find('.marriedResult').attr('id') == "meMarried") {
						if (_getParam(items[0], 'value') == 1) {
							jQuery('#spousePanel').show();
						} else {
							jQuery("#surnameOSC").val(""),
							jQuery("#nameOSC").val(""),
							jQuery("#surnameOSP").val(""),
							jQuery("#nameOSP").val(""),
							jQuery("#phoneS").val(""),
							jQuery("#birthdayS").text("请填写日期"),
							jQuery("#marriedTimeS").text("请填写日期"),
							jQuery('#spousePanel').hide();
						}
					}
				});
			})
			$(".mui-content").on('tap', '.datePicker',function(e) {
				document.activeElement.blur();
				var _self = this;
				if(_self.picker) {
					_self.picker.show(function (rs) {
						jQuery(_self).find(".dateResult").html(rs.text);
						_self.picker.dispose();
						_self.picker = null;
					});
				} else {
					var optionsJson = this.getAttribute('data-options') || '{}';
					var options = JSON.parse(optionsJson);
					_self.picker = new $.DtPicker(options);
					_self.picker.show(function(rs) {
						jQuery(_self).find(".dateResult").html(rs.text);
						_self.picker.dispose();
						_self.picker = null;
					});
				}
			}, false);
		})(mui, document);
		$("#childInfo").on("tap", ".delete-div", function () {
			var _childrenId = $(this).closest('.child-container').find(".childrenId-div").text();
			var _self = $(this);
			if (_childrenId) {
				base.postData(base.url.delFamilyChildrenInfo,{childrenId: _childrenId},function(data) {
					mui.toast(data.message);
					if (data.success) {
						_self.closest(".record-container").remove();
						var itemLength = $("#childInfo").find(".record-title-div").length;
						$("#childInfo .record-title-div").each(function(i, e){
							_self.text("子女信息"+itemLength);
							itemLength--;
						});
					}
				});
			} else {
				_self.closest(".record-container").remove();
				var itemLength = $("#childInfo").find(".record-title-div").length;
				$("#childInfo .record-title-div").each(function(i, e){
					_self.text("子女信息"+itemLength);
					itemLength--;
				});
			}
		})
		$("#addChildren").on("tap", ".right-div", function() {
			document.activeElement.blur();
			$('#childInfo').prepend(getChildHtml());
		})
		function getChildHtml(item) {
			var itemLength = $("#childInfo").find(".record-title-div").length+1;
			var html ='<div class="record-container child-container">'+
					'<div class="childrenId-div"></div>'+
					'<div class="record-title-div">子女信息'+itemLength+'</div>'+
						'<div class="item-div">'+
						'<span class="item-span">曾用姓（中文）</span>'+
						'<input type="text" name="childrenSurnameChinese" placeholder="请输入中文姓"/>'+
					'</div>'+
					'<div class="line-div"></div>'+
					'<div class="item-div">'+
						'<span class="item-span">曾用名（中文）</span>'+
						'<input type="text" name="childrenNameChinese" placeholder="请输入中文名"/>'+
					'</div>'+
					'<div class="line-div"></div>'+
					'<div class="item-div">'+
						'<span class="item-span">曾用姓（拼音）</span>'+
						'<input type="text" name="childrenSurnameEnglish" placeholder="请输入中文名"/>'+
					'</div>'+
					'<div class="line-div"></div>'+
					'<div class="item-div">'+
						'<span class="item-span">曾用名（拼音）</span>'+
						'<input type="text" name="childrenNameChinese" placeholder="请输入中文名"/>'+
					'</div>'+
					'<div class="line-div"></div>'+
					'<div class="item-div">'+
						'<span class="item-span">国籍</span>'+
						'<input type="text" name="childrenNationality" placeholder="请填写国籍"/>'+
					'</div>'+
					'<div class="line-div"></div>'+
					'<div class="item-div">'+
						'<span class="item-span">与您的关系</span>'+
						'<div class="right-div-container relationPicker">'+
							'<span class="right-span relationResult">女儿</span>'+
							'<div class="right-div">'+
								'<img class="choose-img" src="../img/detail/down_color_icon.png" />'+
							'</div>'+
						'</div>'+
					'</div>'+
					'<div class="line-div"></div>'+
					'<div class="item-div">'+
						'<span class="item-span">出生日期</span>'+
						'<div class="right-div-container datePicker" data-options=\'{"type":"date","beginYear":1900,"endYear":2100}\'>'+
							'<span class="right-span dateResult">请填写日期</span>'+
							'<div class="right-div">'+
								'<img class="choose-img" src="../img/detail/down_color_icon.png" />'+
							'</div>'+
						'</div>'+
					'</div>'+
					'<div class="line-div"></div>'+
					'<div class="item-div">'+
						'<span class="item-span">婚姻状况</span>'+
						'<div class="right-div-container marriedPicker">'+
							'<span class="right-span marriedResult">单身</span>'+
							'<div class="right-div">'+
								'<img class="choose-img" src="../img/detail/down_color_icon.png" />'+
							'</div>'+
						'</div>'+
					'</div>'
					if (itemLength>1) {
						html+='<div class="line-div"></div>'
						html+='<div class="item-div delete-div">'
						html+='<span class="item-span" style="color: #FF4747;">删除</span>'
						html+='</div>'
					}
				'</div>'
			return html;
		}
		function getFamilyListData() {
			base.setWait('正在获取数据');
			var url = base.url.getFamilyList;
			var data = {
				customerId: customerId,
				applyCustomerId: applyCustomerId
			};
			base.postData(url,data,getFamilyListSuccess);
		}
		function getFamilyListSuccess(data) {
			if (data.success) {
				familyId = data.extendData.familyId;//家庭Id
				//申请人婚姻状况
				$("#meMarried").text(getMarriedStr(data.extendData.maritalStatus));
				if (data.extendData.maritalStatus == 2) {
					$("#spousePanel").show();
					//配偶信息
					$("#surnameOSC").val(data.extendData.wifeSurnameChinese);
					$("#nameOSC").val(data.extendData.wifeNameChinese);
					$("#surnameOSP").val(data.extendData.wifeSurnameEnglish);
					$("#nameOSP").val(data.extendData.wifeNameEnglish);
					$("#phoneS").val(data.extendData.wifePhone);
					$("#birthdayS").text(data.extendData.wifeBirthday);
					$("#marriedTimeS").text(data.extendData.wifeMarriedTime);
				}
				//父亲信息
				$("#surnameOFC").val(data.extendData.fatherSurnameChinese);
				$("#nameOFC").val(data.extendData.fatherNameChinese);
				$("#surnameOFP").val(data.extendData.fatherSurnameEnglish);
				$("#nameOFP").val(data.extendData.fatherNameEnglish);
				$("#nationalityF").val(data.extendData.fatherNationality);
				$("#birthdayF").text(data.extendData.fatherBirthday);
				$("#fatherMarried").text(getMarriedStr(data.extendData.fatherMaritalStatus));
				$("#FatherLive").text(getWhetherStr(data.extendData.fatherIsAlive));
				//母亲信息
				$("#surnameOMC").val(data.extendData.wifeSurnameChinese);
				$("#nameOMC").val(data.extendData.motherNameChinese);
				$("#surnameOMP").val(data.extendData.motherSurnameEnglish);
				$("#nameOMP").val(data.extendData.motherNameEnglish);
				$("#nationalityM").val(data.extendData.motherNationality);
				$("#birthdayM").text(data.extendData.motherBirthday);
				$("#motherMarried").text(getMarriedStr(data.extendData.motherMaritalStatus));
				$("#motherLive").text(getWhetherStr(data.extendData.motherIsAlive));
				
				//是否有子女
				$("#isChildResult").text(getWhetherStr(data.extendData.isChildren));
				if (data.extendData.isChildren==1) {
					jQuery('#childrenPanel').show();
					var list = data.extendData.familyChildrenList||[];
					var html = '';
					for (var index in list) {
						html+= getListItem(list[index], list.length, list.length-index);
					}
					$('#childInfo').html(html);
				}
			} else {
				mui.toast(data.message);
			}
		}
		function getListItem(item, count, index) {
			var html = '';
			html += '<div class="record-container child-container">'
			html +=		'<div class="childrenId-div">'+item.childrenId+'</div>'
			html +=		'<div class="record-title-div">子女信息'+index+'</div>'
			html +=			'<div class="item-div">'
			html +=			'<span class="item-span">曾用姓（中文）</span>'
			html +=			'<input type="text" name="childrenSurnameChinese" placeholder="请输入中文姓"  value="'+item.childrenSurnameChinese+'"/>'
			html +=		'</div>'
			html +=		'<div class="line-div"></div>'
			html +=		'<div class="item-div">'
			html +=			'<span class="item-span">曾用名（中文）</span>'
			html +=			'<input type="text" name="childrenNameChinese" placeholder="请输入中文名" value="'+item.childrenNameChinese+'"/>'
			html +=		'</div>'
			html +=		'<div class="line-div"></div>'
			html +=		'<div class="item-div">'
			html +=			'<span class="item-span">曾用姓（拼音）</span>'
			html +=			'<input type="text" name="childrenSurnameEnglish" placeholder="请输入中文名" value="'+item.childrenSurnameEnglish+'"/>'
			html +=		'</div>'
			html +=		'<div class="line-div"></div>'
			html +=		'<div class="item-div">'
			html +=			'<span class="item-span">曾用名（拼音）</span>'
			html +=			'<input type="text" name="childrenNameEnglish" placeholder="请输入中文名" value="'+item.childrenNameChinese+'"/>'
			html +=		'</div>'
			html +=		'<div class="line-div"></div>'
			html +=		'<div class="item-div">'
			html +=			'<span class="item-span">国籍</span>'
			html +=			'<input type="text" name="childrenNationality" placeholder="请填写国籍" value="'+item.childrenNationality+'"/>'
			html +=		'</div>'
			html +=		'<div class="line-div"></div>'
			html +=		'<div  class="item-div">'
			html +=			'<span class="item-span">与您的关系</span>'
			html +=			'<div class="right-div-container relationPicker">'
			html +=				'<span class="right-span relationResult">'+getRelationStr(item.relationshipWithMe)+'</span>'
			html +=				'<div class="right-div">'
			html +=					'<img class="choose-img" src="../img/detail/down_color_icon.png" />'
			html +=				'</div>'
			html +=			'</div>'
			html +=		'</div>'
			html +=		'<div class="line-div"></div>'
			html +=		'<div id="nowAddr" class="item-div">'
			html +=			'<span class="item-span">出生日期</span>'
			html +=			'<div class="right-div-container datePicker" data-options=\'{"type":"date","beginYear":1900,"endYear":2100}\'>'
			html +=				'<span class="right-span dateResult">'+item.childrenBirthday+'</span>'
			html +=				'<div class="right-div">'
			html +=					'<img class="choose-img" src="../img/detail/down_color_icon.png" />'
			html +=				'</div>'
			html +=			'</div>'
			html +=		'</div>'
			html +=		'<div class="line-div"></div>'
			html +=		'<div  class="item-div">'
			html +=			'<span class="item-span">婚姻状况</span>'
			html +=			'<div class="right-div-container marriedPicker">'
			html +=				'<span class="right-span marriedResult">'+getMarriedStr(item.childrenMaritalStatus)+'</span>'
			html +=				'<div class="right-div">'
			html +=					'<img class="choose-img" src="../img/detail/down_color_icon.png" />'
			html +=				'</div>'
			html +=			'</div>'
			html +=		'</div>'
			if (count>1) {
				html+=	'<div class="line-div"></div>'
				html+=	'<div class="item-div delete-div">'
				html+=		'<span class="item-span" style="color: #FF4747;">删除</span>'
				html+=	'</div>'
			}
			html +=	'</div>'
			return html;
		}
		$(".transaction-container").on("tap", "button", function() {
			var url = base.url.addFamilyInfo;
			var childrenList = new Array();
			$("#childInfo").find(".child-container").each(function(index, item){
				var itemParams = {
					childrenId:$(this).find(".childrenId-div").text(),
					childrenSurnameChinese:$(this).find("input[name='childrenSurnameChinese']").val(),
					childrenNameChinese:$(this).find("input[name='childrenNameChinese']").val(),
					childrenSurnameEnglish:$(this).find("input[name='childrenSurnameEnglish']").val(),
					childrenNameEnglish:$(this).find("input[name='childrenNameEnglish']").val(),
					childrenNationality:$(this).find("input[name='childrenNationality']").val(),
					childrenBirthday:$(this).find(".dateResult").text(),
					childrenMaritalStatus:getMarriedValue($(this).find(".marriedResult").text()),
					relationshipWithMe:getRelationValue($(this).find(".relationResult").text())
				}
				childrenList.push(itemParams);
			});
			childrenList = JSON.stringify(childrenList);
			var params = {
				customerId: customerId,
				applyCustomerId: applyCustomerId,
				familyId: familyId,
				maritalStatus: getMarriedValue($("#meMarried").text()),
				//配偶信息
				wifeSurnameChinese: $("#surnameOSC").val(),
				wifeNameChinese: $("#nameOSC").val(),
				wifeSurnameEnglish: $("#surnameOSP").val(),
				wifeNameEnglish: $("#nameOSP").val(),
				wifePhone: $("#phoneS").val(),
				wifeBirthday: $("#birthdayS").text()!="请填写日期"?$("#birthdayS").text():"",
				wifeMarriedTime: $("#marriedTimeS").text()!="请填写日期"?$("#marriedTimeS").text():"",
				//父亲信息
				fatherSurnameChinese: $("#surnameOFC").val(),
				fatherNameChinese: $("#nameOFC").val(),
				fatherSurnameEnglish: $("#surnameOFP").val(),
				fatherNameEnglish: $("#nameOFP").val(),
				fatherNationality: $("#nationalityF").val(),
				fatherBirthday: $("#birthdayF").text(),
				fatherMaritalStatus: getMarriedValue($("#fatherMarried").text()),
				fatherIsAlive: getWhetherValue($("#FatherLive").text()),
				//母亲信息
				motherSurnameChinese: $("#surnameOMC").val(),
				motherNameChinese: $("#nameOMC").val(),
				motherSurnameEnglish: $("#surnameOMP").val(),
				motherNameEnglish: $("#nameOMP").val(),
				motherNationality: $("#nationalityM").val(),
				motherBirthday: $("#birthdayM").text(),
				motherMaritalStatus: getMarriedValue($("#motherMarried").text()),
				motherIsAlive: getWhetherValue($("#motherLive").text()),
				//是否有子女和子女的信息
				isChildren: getWhetherValue($("#isChildResult").text()),
				childrenParameter: getWhetherValue($("#isChildResult").text())==1?childrenList:""
			};
			console.log(params);
			base.postData(url,params,addFamilyInfoSuccess);
		})
		function addFamilyInfoSuccess(data) {
			mui.toast(data.message);
			if (data.success) {
				setTimeout(function() {
					mui.back();
				}, 1000);
			}
		}
	</script>
</html>